home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / man.n / radiobutton.n < prev    next >
Text File  |  1995-07-21  |  15KB  |  467 lines

  1. '\"
  2. '\" Copyright (c) 1990 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/wish/man/RCS/radiobutton.n,v 1.21 93/04/01 09:52:52 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .\" The definitions below are for supplemental macros used in Tcl/Tk
  24. .\" manual entries.
  25. .\"
  26. .\" .HS name section [date [version]]
  27. .\"    Replacement for .TH in other man pages.  See below for valid
  28. .\"    section names.
  29. .\"
  30. .\" .AP type name in/out [indent]
  31. .\"    Start paragraph describing an argument to a library procedure.
  32. .\"    type is type of argument (int, etc.), in/out is either "in", "out",
  33. .\"    or "in/out" to describe whether procedure reads or modifies arg,
  34. .\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  35. .\"    needed;  use .AS below instead)
  36. .\"
  37. .\" .AS [type [name]]
  38. .\"    Give maximum sizes of arguments for setting tab stops.  Type and
  39. .\"    name are examples of largest possible arguments that will be passed
  40. .\"    to .AP later.  If args are omitted, default tab stops are used.
  41. .\"
  42. .\" .BS
  43. .\"    Start box enclosure.  From here until next .BE, everything will be
  44. .\"    enclosed in one large box.
  45. .\"
  46. .\" .BE
  47. .\"    End of box enclosure.
  48. .\"
  49. .\" .VS
  50. .\"    Begin vertical sidebar, for use in marking newly-changed parts
  51. .\"    of man pages.
  52. .\"
  53. .\" .VE
  54. .\"    End of vertical sidebar.
  55. .\"
  56. .\" .DS
  57. .\"    Begin an indented unfilled display.
  58. .\"
  59. .\" .DE
  60. .\"    End of indented unfilled display.
  61. .\"
  62. '\"    # Heading for Tcl/Tk man pages
  63. .de HS
  64. .ds ^3 \\0
  65. .if !"\\$3"" .ds ^3 \\$3
  66. .if '\\$2'cmds'       .TH \\$1 1 \\*(^3 \\$4
  67. .if '\\$2'lib'        .TH \\$1 3 \\*(^3 \\$4
  68. .if '\\$2'tcl'        .TH \\$1 n \\*(^3 Tcl "Tcl Built-In Commands"
  69. .if '\\$2'tk'         .TH \\$1 n \\*(^3 Tk "Tk Commands"
  70. .if '\\$2'tclc'        .TH \\$1 3 \\*(^3 Tcl "Tcl Library Procedures"
  71. .if '\\$2'tkc'         .TH \\$1 3 \\*(^3 Tk "Tk Library Procedures"
  72. .if '\\$2'tclcmds'         .TH \\$1 1 \\*(^3 Tk "Tcl Applications"
  73. .if '\\$2'tkcmds'         .TH \\$1 1 \\*(^3 Tk "Tk Applications"
  74. .if t .wh -1.3i ^B
  75. .nr ^l \\n(.l
  76. .ad b
  77. ..
  78. '\"    # Start an argument description
  79. .de AP
  80. .ie !"\\$4"" .TP \\$4
  81. .el \{\
  82. .   ie !"\\$2"" .TP \\n()Cu
  83. .   el          .TP 15
  84. .\}
  85. .ie !"\\$3"" \{\
  86. .ta \\n()Au \\n()Bu
  87. \&\\$1    \\fI\\$2\\fP    (\\$3)
  88. .\".b
  89. .\}
  90. .el \{\
  91. .br
  92. .ie !"\\$2"" \{\
  93. \&\\$1    \\fI\\$2\\fP
  94. .\}
  95. .el \{\
  96. \&\\fI\\$1\\fP
  97. .\}
  98. .\}
  99. ..
  100. '\"    # define tabbing values for .AP
  101. .de AS
  102. .nr )A 10n
  103. .if !"\\$1"" .nr )A \\w'\\$1'u+3n
  104. .nr )B \\n()Au+15n
  105. .\"
  106. .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  107. .nr )C \\n()Bu+\\w'(in/out)'u+2n
  108. ..
  109. '\"    # BS - start boxed text
  110. '\"    # ^y = starting y location
  111. '\"    # ^b = 1
  112. .de BS
  113. .br
  114. .mk ^y
  115. .nr ^b 1u
  116. .if n .nf
  117. .if n .ti 0
  118. .if n \l'\\n(.lu\(ul'
  119. .if n .fi
  120. ..
  121. '\"    # BE - end boxed text (draw box now)
  122. .de BE
  123. .nf
  124. .ti 0
  125. .mk ^t
  126. .ie n \l'\\n(^lu\(ul'
  127. .el \{\
  128. .\"    Draw four-sided box normally, but don't draw top of
  129. .\"    box if the box started on an earlier page.
  130. .ie !\\n(^b-1 \{\
  131. \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  132. .\}
  133. .el \}\
  134. \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  135. .\}
  136. .\}
  137. .fi
  138. .br
  139. .nr ^b 0
  140. ..
  141. '\"    # VS - start vertical sidebar
  142. '\"    # ^Y = starting y location
  143. '\"    # ^v = 1 (for troff;  for nroff this doesn't matter)
  144. .de VS
  145. .mk ^Y
  146. .ie n 'mc \s12\(br\s0
  147. .el .nr ^v 1u
  148. ..
  149. '\"    # VE - end of vertical sidebar
  150. .de VE
  151. .ie n 'mc
  152. .el \{\
  153. .ev 2
  154. .nf
  155. .ti 0
  156. .mk ^t
  157. \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  158. .sp -1
  159. .fi
  160. .ev
  161. .\}
  162. .nr ^v 0
  163. ..
  164. '\"    # Special macro to handle page bottom:  finish off current
  165. '\"    # box/sidebar if in box/sidebar mode, then invoked standard
  166. '\"    # page bottom macro.
  167. .de ^B
  168. .ev 2
  169. 'ti 0
  170. 'nf
  171. .mk ^t
  172. .if \\n(^b \{\
  173. .\"    Draw three-sided box if this is the box's first page,
  174. .\"    draw two sides but no top otherwise.
  175. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  176. .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  177. .\}
  178. .if \\n(^v \{\
  179. .nr ^x \\n(^tu+1v-\\n(^Yu
  180. \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  181. .\}
  182. .bp
  183. 'fi
  184. .ev
  185. .if \\n(^b \{\
  186. .mk ^y
  187. .nr ^b 2
  188. .\}
  189. .if \\n(^v \{\
  190. .mk ^Y
  191. .\}
  192. ..
  193. '\"    # DS - begin display
  194. .de DS
  195. .RS
  196. .nf
  197. .sp
  198. ..
  199. '\"    # DE - end display
  200. .de DE
  201. .fi
  202. .RE
  203. .sp .5
  204. ..
  205. .HS radiobutton tk
  206. .BS
  207. '\" Note:  do not modify the .SH NAME line immediately below!
  208. .SH NAME
  209. radiobutton \- Create and manipulate radio-button widgets
  210. .SH SYNOPSIS
  211. \fBradiobutton\fI \fIpathName \fR?\fIoptions\fR?
  212. .SH "STANDARD OPTIONS"
  213. .LP
  214. .nf
  215. .ta 4c 8c 12c
  216. .VS
  217. \fBactiveBackground\fR    \fBbitmap\fR    \fBfont\fR    \fBrelief\fR
  218. \fBactiveForeground\fR    \fBborderWidth\fR    \fBforeground\fR    \fBtext\fR
  219. \fBanchor\fR    \fBcursor\fR    \fBpadX\fR    \fBtextVariable\fR
  220. \fBbackground\fR    \fBdisabledForeground\fR    \fBpadX\fR
  221. .VE
  222. .fi
  223. .LP
  224. See the ``options'' manual entry for details on the standard options.
  225. .SH "WIDGET-SPECIFIC OPTIONS"
  226. .ta 4c
  227. .LP
  228. .nf
  229. Name:    \fBcommand\fR
  230. Class:    \fBCommand\fR
  231. Command-Line Switch:    \fB\-command\fR
  232. .fi
  233. .IP
  234. Specifies a Tcl command to associate with the button.  This command
  235. is typically invoked when mouse button 1 is released over the button
  236. window.  The button's global variable (\fB\-variable\fR option) will
  237. be updated before the command is invoked.
  238. .LP
  239. .nf
  240. .VS
  241. Name:    \fBheight\fR
  242. Class:    \fBHeight\fR
  243. Command-Line Switch:    \fB\-height\fR
  244. .fi
  245. .IP
  246. Specifies a desired height for the button.
  247. If a bitmap is being displayed in the button then the value is in
  248. screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
  249. for text it is in lines of text.
  250. If this option isn't specified, the button's desired height is computed
  251. from the size of the bitmap or text being displayed in it.
  252. .VE
  253. .LP
  254. .nf
  255. Name:    \fBselector\fR
  256. Class:    \fBForeground\fR
  257. Command-Line Switch:    \fB\-selector\fR
  258. .fi
  259. .IP
  260. Specifies the color to draw in the selector when this button is
  261. selected.
  262. .VS
  263. If specified as an empty string then no selector is drawn for the button.
  264. .LP
  265. .nf
  266. Name:    \fBstate\fR
  267. Class:    \fBState\fR
  268. Command-Line Switch:    \fB\-state\fR
  269. .fi
  270. .IP
  271. Specifies one of three states for the radio button:  \fBnormal\fR, \fBactive\fR,
  272. or \fBdisabled\fR.  In normal state the radio button is displayed using the
  273. \fBforeground\fR and \fBbackground\fR options.  The active state is
  274. typically used when the pointer is over the radio button.  In active state
  275. the radio button is displayed using the \fBactiveForeground\fR and
  276. \fBactiveBackground\fR options.  Disabled state means that the radio button
  277. is insensitive:  it doesn't activate and doesn't respond to mouse
  278. button presses.  In this state the \fBdisabledForeground\fR and
  279. \fBbackground\fR options determine how the radio button is displayed.
  280. .VE
  281. .LP
  282. .nf
  283. Name:    \fBvalue\fR
  284. Class:    \fBValue\fR
  285. Command-Line Switch:    \fB\-value\fR
  286. .fi
  287. .IP
  288. Specifies value to store in the button's associated variable whenever
  289. this button is selected.  Defaults to the name of the radio button.
  290. .LP
  291. .nf
  292. Name:    \fBvariable\fR
  293. Class:    \fBVariable\fR
  294. Command-Line Switch:    \fB\-variable\fR
  295. .fi
  296. .IP
  297. Specifies name of global variable to set whenever this button is
  298. selected.  Changes in this variable also cause the button to select
  299. or deselect itself.
  300. Defaults to the value \fBselectedButton\fR.
  301. .LP
  302. .nf
  303. .VS
  304. Name:    \fBwidth\fR
  305. Class:    \fBWidth\fR
  306. Command-Line Switch:    \fB\-width\fR
  307. .fi
  308. .IP
  309. Specifies a desired width for the button.
  310. If a bitmap is being displayed in the button then the value is in
  311. screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
  312. for text it is in characters.
  313. If this option isn't specified, the button's desired width is computed
  314. from the size of the bitmap or text being displayed in it.
  315. .VE
  316. .BE
  317.  
  318. .SH DESCRIPTION
  319. .PP
  320. The \fBradiobutton\fR command creates a new window (given by the
  321. \fIpathName\fR argument) and makes it into a radiobutton widget.
  322. Additional
  323. options, described above, may be specified on the command line
  324. or in the option database
  325. to configure aspects of the radio button such as its colors, font,
  326. text, and initial relief.  The \fBradiobutton\fR command returns its
  327. \fIpathName\fR argument.  At the time this command is invoked,
  328. there must not exist a window named \fIpathName\fR, but
  329. \fIpathName\fR's parent must exist.
  330. .PP
  331. A radio button is a widget
  332. .VS
  333. that displays a textual string or bitmap
  334. and a diamond called a \fIselector\fR.
  335. A radio button has
  336. all of the behavior of a simple button: it can display itself in either
  337. of three different ways, according to the \fBstate\fR option;
  338. .VE
  339. it can be made to appear
  340. raised, sunken, or flat; it can be made to flash; and it invokes
  341. a Tcl command whenever mouse button 1 is clicked over the
  342. check button.
  343. .PP
  344. In addition, radio buttons can be \fIselected\fR.
  345. If a radio button is selected then a special highlight appears
  346. in the selector and a Tcl variable associated with the radio button
  347. is set to a particular value.
  348. If the radio button is not selected then the selector is drawn
  349. in a different fashion.
  350. Typically, several radio buttons share a single variable and the
  351. value of the variable indicates which radio button is to be selected.
  352. .VS
  353. When a radio button is selected it sets the value of the variable to
  354. indicate that fact;  each radio button also monitors the value of
  355. the variable and automatically selects and deselects itself when the
  356. variable's value changes.
  357. .VE
  358. By default the variable \fBselectedButton\fR
  359. is used;  its contents give the name of the button that is
  360. selected, or the empty string if no button associated with that
  361. variable is selected.
  362. The name of the variable for a radio button,
  363. plus the variable to be stored into it, may be modified with options
  364. on the command line or in the option database.  By default a radio
  365. button is configured to select itself on button clicks.
  366.  
  367. .SH "WIDGET COMMAND"
  368. .PP
  369. The \fBradiobutton\fR command creates a new Tcl command whose
  370. name is \fIpathName\fR.  This
  371. command may be used to invoke various
  372. operations on the widget.  It has the following general form:
  373. .DS C
  374. \fIpathName option \fR?\fIarg arg ...\fR?
  375. .DE
  376. \fIOption\fR and the \fIarg\fRs
  377. determine the exact behavior of the command.  The following
  378. commands are possible for radio-button widgets:
  379. .TP
  380. \fIpathName \fBactivate\fR
  381. Change the radio button's state to \fBactive\fR and redisplay the button
  382. using its active foreground and background colors instead of normal
  383. colors.
  384. .VS
  385. This command is ignored if the radio button's state is \fBdisabled\fR.
  386. This command is obsolete and will eventually be removed;
  387. use ``\fIpathName \fBconfigure \-state active\fR'' instead.
  388. .TP
  389. \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
  390. Query or modify the configuration options of the widget.
  391. If no \fIoption\fR is specified, returns a list describing all of
  392. the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
  393. information on the format of this list).  If \fIoption\fR is specified
  394. with no \fIvalue\fR, then the command returns a list describing the
  395. one named option (this list will be identical to the corresponding
  396. sublist of the value returned if no \fIoption\fR is specified).  If
  397. one or more \fIoption\-value\fR pairs are specified, then the command
  398. modifies the given widget option(s) to have the given value(s);  in
  399. this case the command returns an empty string.
  400. \fIOption\fR may have any of the values accepted by the \fBradiobutton\fR
  401. command.
  402. .TP
  403. \fIpathName \fBdeactivate\fR
  404. Change the radio button's state to \fBnormal\fR and redisplay the button
  405. using its normal foreground and background colors.
  406. .VS
  407. This command is ignored if the radio button's state is \fBdisabled\fR.
  408. This command is obsolete and will eventually be removed;
  409. use ``\fIpathName \fBconfigure \-state normal\fR'' instead.
  410. .VE
  411. .TP
  412. \fIpathName \fBdeselect\fR
  413. Deselect the radio button:  redisplay it without a highlight in
  414. the selector and set the associated variable to an empty string.  If
  415. this radio button was not currently selected, then the command has
  416. no effect.
  417. .TP
  418. \fIpathName \fBflash\fR
  419. Flash the radio button.  This is accomplished by redisplaying the radio button
  420. several times, alternating between active and normal colors.  At
  421. the end of the flash the radio button is left in the same normal/active
  422. state as when the command was invoked.
  423. .VS
  424. This command is ignored if the radio button's state is \fBdisabled\fR.
  425. .VE
  426. .TP
  427. \fIpathName \fBinvoke\fR
  428. .VS
  429. Does just what would have happened if the user invoked the radio button
  430. with the mouse: select the button and invoke
  431. its associated Tcl command, if there is one.
  432. The return value is the return value from the Tcl command, or an
  433. empty string if there is no command associated with the radio button.
  434. This command is ignored if the radio button's state is \fBdisabled\fR.
  435. .VE
  436. .TP
  437. \fIpathName \fBselect\fR
  438. Select the radio button:  display it with a highlighted
  439. selector and set the associated variable to the value corresponding
  440. to this widget.
  441.  
  442. .SH BINDINGS
  443. .PP
  444. .VS
  445. Tk automatically creates class bindings for radio buttons that give them
  446. the following default behavior:
  447. .IP [1]
  448. The radio button activates whenever the mouse passes over it and deactivates
  449. whenever the mouse leaves the radio button.
  450. .IP [2]
  451. The radio button's relief is changed to sunken whenever mouse button 1 is
  452. pressed over it, and the relief is restored to its original
  453. value when button 1 is later released.
  454. .IP [3]
  455. If mouse button 1 is pressed over the radio button and later released over
  456. the radio button, the radio button is invoked (i.e. it is selected
  457. and the command associated with the button is invoked,
  458. if there is one).  However, if the mouse is not
  459. over the radio button when button 1 is released, then no invocation occurs.
  460. .PP
  461. The behavior of radio buttons can be changed by defining new bindings for
  462. individual widgets or by redefining the class bindings.
  463. .VE
  464.  
  465. .SH KEYWORDS
  466. radio button, widget
  467.